﻿@model IEnumerable<Package>
@{
    Layout = "~/Views/Shared/_Dashboard.cshtml";
}
@UIHelper.ImageTitle(Html.Global("RES_WEBTEMPL"), Html.Global("Solution_Desc"), "~/content/images/img_download_48.png")

<p>
    @Ajax.Dna().Link(Html.Global("RES_HELP"), Url.Help(4), Url.Content("~/content/images/help.png")).Options(opts => { opts.Target = "_blank"; }).GetHtml()
</p>

@UIHelper.SectionHeader(Html.Global("RES_BROWSE"))

@foreach (var pkg in Model)
{
    if (pkg != null)
    {
    <table>
        <tr>
            <td style="width: 200px; vertical-align: top; text-align: center;">
                @{var _img = pkg.Images.FirstOrDefault();}
                @if (_img != null)
                {
                    <img src="@pkg.ResolveUrl(_img.Url)" alt="@pkg.Title" />
                }
                <div>
                    @Ajax.Dna().Button().LocText("RES_APPLY").ImageIcons(Url.Content("~/content/images/icon_accept_16.png")).Click("location=\"" + Url.Action("Create", "Solution", new { solution = pkg.Name }) + "\"").GetHtml()
                    @Ajax.Dna().Button().LocText("RES_SAVE").ImageIcons(Url.Content("~/content/images/icon_save.gif")).Click("window.open(\"" + Url.Action("Download", new { name = pkg.Name }) + "\");").GetHtml()
                </div>
            </td>
            <td style="vertical-align: top;">
                @UIHelper.PackageInfo(pkg)
            </td>
        </tr>
    </table>
    <hr />
    }
}